<?php
/**
 * +-------------------------------------------------------------
 * |Caption:
 * +-------------------------------------------------------------
 * |Author: Lenny
 * +-------------------------------------------------------------
 * |Email:  1685964109@qq.com
 * +-------------------------------------------------------------
 * |Date:   2024/7/3 下午7:33
 * +-------------------------------------------------------------
 */

namespace app\admin\model;

use app\admin\validate\ProductValidate;
use app\common\model\BaseModel;
use think\Model;
use think\model\relation\BelongsTo;
use think\model\relation\HasMany;

class Product extends BaseModel
{
    protected $deleteTime = 'delete_time';

    public function cate(): BelongsTo
    {
        return $this->belongsTo(ProductCate::class, 'cate_id', 'id');
    }

    public function specs(): HasMany
    {
        return $this->hasMany(ProductSpecs::class, 'product_id', 'id');
    }

}